<script type="text/javascript">
  var Connect = YAHOO.util.Connect,
  JSON = YAHOO.lang.JSON,
  Dom = YAHOO.util.Dom,
  Lang = YAHOO.lang,
  Constants = YAHOO.TRZCINKA.VCARD.Constants;

  YAHOO.util.Event.onContentReady('vcard', function() {
    //we initiate editor only when locales.js is loaded
    var timer = Lang.later(100, this, function() {
      if (typeof I18n != 'undefined' && typeof I18n.locale != 'undefined') {
        timer.cancel();
        var gridModel = new YAHOO.TRZCINKA.VCARD.GridModel('<%= @account_type %>');
        var vcard = new YAHOO.TRZCINKA.VCARD.VCard('vcard', gridModel);
        vcard.render();
        var gridDataString = '<%= escape_javascript @grid %>';
        var gridData = JSON.parse(gridDataString);
        gridModel.loadGrid(gridData);
      }
    }, null, true);
  });

<% if current_user.account_type == 'operator' %>
    var oButton = new YAHOO.widget.Button({
      id: "mybuttonid",
      type: "button",
      label: "<%= t :change_dimensions, :scope => %w{editor top_menu} %>",
      container: "buttons",
      onclick: {fn: function(){
          YAHOO.TRZCINKA.VCARD.DimensionsEditor._editor.show();
        }}});
<% end %>

</script>

<div class="body_resize">
  <div class="full_b">
    <div id="messages_div" class="messages"></div>
    <div id="buttons"></div>
  </div>
</div>

<div id="vcard"></div>